<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>锚点定位</title>
  <link rel="stylesheet" href="./css/demo.css">
</head>

<body>
  <div id="a">
    <h2>A</h2>
  </div>
  <div id="b">
    <h2>B</h2>
  </div>
  <div id="c">
    <h2>C</h2>
  </div>
  <div class="locate">
    <!-- a*3 -->
    <a href="#a">A</a>
    <a href="#b">B</a>
    <a href="#c">C</a>
  </div>
</body>

</html>